x86/smp: do not use scratch_cpumask when in interrupt or exception context
authorRoger Pau Monné <roger.pau@citrix.com>
Wed, 26 Feb 2020 16:38:58 +0000 (17:38 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 26 Feb 2020 16:38:58 +0000 (17:38 +0100)
commitd079cc05873904c855bf2fb4d8db72fbb3727c9d
treea1b1731699d4940a7f5d54bf542f4116cf98c657
parent125c582bfdd4b673ee4458b0a41277ae9d52448b
x86/smp: do not use scratch_cpumask when in interrupt or exception context

Using scratch_cpumask in send_IPI_mask is not safe in IRQ or exception
context because it can nest, and hence send_IPI_mask could be
overwriting another user scratch cpumask data when used in such
contexts.

Fallback to not using the scratch cpumask (and hence not attemping to
optimize IPI sending by using a shorthand) when in IRQ or exception
context. Note that the scratch cpumask cannot be used when
non-maskable interrupts are being serviced (NMI or #MC) and hence
fallback to not using the shorthand in that case, like it was done
previously.

Fixes: 5500d265a2a8 ('x86/smp: use APIC ALLBUT destination shorthand when possible')
Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/smp.c